<?php
		include "../../connect.php";
		$sql="SELECT * FROM phieudatsan where TIMESTAMPDIFF(HOUR,NgayLap,CURRENT_TIMESTAMP())>=24 and TrangThai=0";
		$result = mysql_query($sql);
		while($row=mysql_fetch_array($result))	
		{
			$id=$row['PhieuDatSanID'];
			$UpdateState="Update phieudatsan set TrangThai=3 where PhieuDatSanID='$id'";
			echo $UpdateState;
			$resultUp = mysql_query($UpdateState);
		}
?>